#ifndef CLAW_SIGNAL_H
#define CLAW_SIGNAL_H
#include "oslib.h"

//放箭外部事件触发
#define TAKE_ARROW_START      (1UL<<0)
#define CLAW_OPEN             (1UL<<1)
#define CLAW_MOVE             (1UL<<2)
//三个大疆电机到达目标事件触发
#define RISE_GET_POSITION     (1UL<<3)
#define RISE_FINSIH_HOMING    (1UL<<4)
#define ROLL_GET_POSITION     (1UL<<5)
#define ROLL_FINSIH_HOMING    (1UL<<6)
#define MOVE_GET_POSITION     (1UL<<7)
#define MOVE_FINISH_HOMING    (1UL<<8)

extern osEventFlagsId_t EventTakeArrowHandle;  //事件标志组

extern uint16_t loosen_order;                  //放箭的顺序控制
extern uint16_t ga_mode_flag;                  //两种取箭方式（0取三支箭，1取剩余两支箭）
extern uint16_t ga_machine_flag;               //状态机开启控制标志


/*开关取箭状态机控制函数*/
extern void Sign_OpenClawMachine();
extern void Sign_CloseClawMachine();

/*取箭上膛信号量激活函数*/
extern void Signal_StartTakeArrow();
extern void Signal_MoveClaw();
extern void Signal_OpenClaw();

/*清除取箭所有信号量*/
extern void Signal_CleanClaw();

/*大疆电机到位置反馈处理函数*/
void Claw_DjiPosOK(int16_t boardid, int16_t motorid);
void Claw_DjiResetOK(int16_t boardid, int16_t motorid);

#endif // CLAW_SIGNAL_H